package com.aichess.controller;

import com.aichess.service.AIService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/chess")
public class ChessController {
    
    @Autowired
    private AIService aiService;

    @PostMapping("/move")
    public String getAIMove(
            @RequestParam String fen, 
            @RequestParam String player) {
        return aiService.getMove(fen, player);
    }
} 